<?php if(!empty($email)) { ?>
<?php $_TPL['title'][]=$email['title']; ?>
<?php } ?>
<?php $_TPL['title'][]='邮件模板设置'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title><?php if(is_array($_TPL['title'])) { foreach($_TPL['title'] as $title) { ?> <?php echo $title ;?> - <?php } } ?>对话中国</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <script type="text/javascript" src="include/js/jquery-1.4.4.min.js"></script>
        <script type="text/javascript" src="include/js/common.js"></script>
        <script type="text/javascript" src="include/js/header.js"></script>
        <style type="text/css">
            @import url(template/default/style.css);
        </style>
    </head>
    <body>
        <div id="warp">
            <div id="header">
                <div id="header_top">
                    <div class="left"><img src="template/default/image/bg_corner_top.gif"/></div>
                    <div class="right">
                        <?php if($_SGLOBAL['supe_uid']) { ?>
                        <div id="header_login">
                            <a href="#">退出</a>
                        </div>
                        <div id="header_nav">
                            <ul>
                                <li id="nav_company"><a href="setup.php?ac=company"><img src="template/default/image/b_manage.gif" /></a></li>
                                <li id="nav_interface"><img src="template/default/image/b_interface.gif" /></li>
                                <li id="nav_support"><img src="template/default/image/b_profile.gif" /></li>
                                <li id="nav_session"><img src="template/default/image/b_sessions.gif" /></li>
                                <li id="nav_prefs"><a href="setup.php?ac=profile"><img src="template/default/image/b_prefs-over.gif" /></a></li>
                            </ul>
                            <div class="clear"></div>
                        </div>
                        <?php } ?>
                    </div>
                    <div class="clear"></div>
                </div>
                <div id="header_bottom">
                    <div class="left">
                        <a href="">::首页</a>
                    </div>
                    <div class="header_bottom_bg_menu">&nbsp;</div>
                    <div class="right">
                        <?php if($_SGLOBAL['supe_uid']) { ?>
                        <div id="header_submenu">
                            <div <?php echo $submenu['none'] ;?>>
                                欢迎管理dialogcn的管理员区域
                            </div>
                            <div <?php echo $submenu['prefs'] ;?> id="submenu_prefs">
                                <a href="setup.php?ac=email">邮件模板</a>
                                <a href="setup.php?ac=global">全局设置</a>
                            </div>
                            <div <?php echo $submenu['support'] ;?> id="submenu_support">
                                <a href="#">客服申请</a>
                                <a href="#">客服人员评分</a>
                                <a href="#">客服人员头像</a>
                            </div>
                            <div <?php echo $submenu['session'] ;?> id="submenu_session">
                                <a href="#">当前回话</a>
                                <a href="#">当前回话</a>
                            </div>
                            <div <?php echo $submenu['interface'] ;?> id="submenu_interface">
                                <a href="#">主题</a>
                                <a href="#">图标</a>
                            </div>
                            <div <?php echo $submenu['company'] ;?> id="submenu_company">
                                <a href="setup.php?ac=company&op=list">公司列表</a>
                                <a href="setup.php?ac=company&op=add">添加公司</a>
                                <a href="setup.php?ac=company&op=search">搜索公司</a>
                            </div>
                        </div>
                        <?php } ?>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
<div id="content">
    <h5>设置：邮件模板设置</h5>
    <?php if(!empty($emaillist)) { ?>
    <p>你可以在这里设置给用户发送相关邮件模板，下面是模板列表</p>
    <ul>
        <?php if(is_array($emaillist)) { foreach($emaillist as $email) { ?>
        <li><a href="setup.php?ac=email&id=<?php echo $email['id'] ;?>"><?php echo $email['title'] ;?></a></li>
        <?php } } ?>
    </ul>
    <?php } else { ?>
    <p><?php echo $email['title'] ;?></p>
    <form id="emailform" action="setup.php?ac=email&id=<?php echo $email['id'] ;?>" method="post">
        <input type="hidden" name="formhash" value="<?php echo $_SGLOBAL['formhash'] ;?>"/>
        <input type="hidden" name="emailsubmit" value="true"/>
        <table class="form_table" cellpadding="0" cellspacing="0">
            <tr>
                <th>标题：</th>
                <td><input type="text" class="i_input" name="subject" value="<?php echo $email['subject'] ;?>"/></td>
            </tr>
            <tr>
                <th>内容：</th>
                <td>
                    <p>
                        <span class="important_string">%username%</span>-客户的用户名<br/>
                        <span class="important_string">%nickname%</span>-昵称<br/>
                        <span class="important_string">%company_name%</span>-公司名
                    </p>
                    <textarea class="i_input" name="content" cols="80" rows="20"><?php echo $email['content'] ;?></textarea>
                </td>
            </tr>
            <tr>
                <th>&nbsp;</th>
                <td>
                    <input id="emailsubmit" type="button" value="修改" class="i_submit"/>
                    <span id="emailchange"></span>
                </td>
            </tr>
        </table>
    </form>
    <script type="text/javascript">
        $(function(){
            $("#emailsubmit").click(function(){
                ajaxform('emailform','emailchange');
            });
        });
    </script>
    <?php } ?>
</div>
<div id="siber_icon"><img src="template/default/image/g_prefs_big.jpg"/></div>
<div class="clear"></div>
<div id="footer">
    对话中国版权所有
</div>
</div>
</body>
</html>
